package benchmarks.tpch.utils;

public class Tuple {
    public final int p1;
    public final int p2;

    public Tuple(int p1, int p2) {
        this.p1 = p1;
        this.p2 = p2;
    }

    public int hashCode() {
        int hash = 17;
        hash = hash * 31 + Integer.hashCode(p1);
        hash = hash * 31 + Integer.hashCode(p2);
//        return (int) (p1 << 16 + p2);
        return hash;
    }

    public boolean equals(Object o) {
        if (o instanceof Tuple) {
            if (p1 == ((Tuple) o).p1 && p2 == ((Tuple) o).p2) {
                return true;
            }
        }
        return false;
    }
}
